﻿@using Newtouch.Infrastructure;
@{
    ViewBag.Title = "结算出库数量明细统计";
    Layout = "~/Views/Shared/_Index.cshtml";
}

<style>
    #btn_print {
        background-color: #fff;
        color: #00a9ea;
        font-weight: bolder;
    }
</style>
<form id="form1">
    <div class="panel panel-default">
        <div class="panel-heading">搜索</div>
        <div>
            <table class="form">
                <tr>
                    <th class="formTitle ">统计日期:</th>
                    <td class="formValue">
                        <input id="startTime" type="text" class="form-control input-wdatepicker " value="@DateTime.Now.ToString("yyyy-MM-dd 00:00:00")" on onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" />
                    </td>
                    <th class="formTitle">到：</th>
                    <td class="formValue">
                        <input id="endTime" type="text" class="form-control input-wdatepicker " value="@DateTime.Now.AddHours(1).ToString("yyyy-MM-dd HH:mm:ss")" on onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" />
                    </td>
                    <th class="formTitle">大类：</th>
                    <td class="formValue">
                        <select id="ypdl" class="form-control">
                            <option value="">全部</option>
                        </select>
                    </td>
                    <th class="formTitle">科室：</th>
                    <td class="formValue">
                        <select id="depa" class="form-control">
                            <option value="">全部</option>
                        </select>
                    </td>
                    <th class="formTitle">病区：</th>
                    <td class="formValue formDdlSelectorTd">
                        <select id="bqmc" class="form-control">
                            <option value="">全部</option>
                        </select>
                    </td>
                    <td class="formTitle">
                        <input type="button" id="btn_search" class="btn btn-primary" value="查询" style="margin-left:10px;" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="ui-layout" id="dv_layout" style="width: 100%; height: 100%;">
        <iframe class="ui-layout-center" style="width:100%; height: 100%;" id="if_data" name="if_data" scrolling="auto" allowtransparency="true" frameborder="0"></iframe>
    </div>
</form>
<script>
    $(function () {
        $("#depa").bindSelect({
            id: "Code",
            text: "Name",
            url: "/ReportManage/YpckQuery/GetSysDepartmentList",
            dropdownAutoWidth: true
        });
        $("#bqmc").bindSelect({ //病区信息集合
            url: "/HospitalizationPharmacy/GetBQSelectJson",
            id: "bqCode",
            text: "bqmc"
        });
        $("#ypdl").bindSelect({ //病区信息集合
            url: "/ReportManage/JsYpcx/GetDlList",
            id: "dlcode",
            text: "dlmc"
        });

        $('#if_data').css('height', $(window).height() - 85);

        //查询
        $("#btn_search").click(function () {
            var ksname = "";
            if ($("#depa").find("option:selected").text()!="全部") {
                ksname = $("#depa").find("option:selected").text();
            }
            var url =
                "../../Report/PrintReport?type=Ypcktj_MXReport&param=orgId=@ViewBag.OrganizeId" +
                "|dlcode=" +
                $("#ypdl").val() +
                "|kssj=" +
                $('#startTime').val() +
                "|jssj=" +
                $('#endTime').val()+
                "|bqCode=" +
                $("#bqmc").val() +
                "|ksName=" +
                ksname;
            $("#if_data").attr('src', url);
        });
    });

</script>
